﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Beacon.Random
{
    public class StandardGenerator :Generator
    {
        private System.Random _generator;
        private int _seed;

        public StandardGenerator()
            : this(Environment.TickCount)
        {
        }

        public StandardGenerator(int seed)
        {
            _seed = Math.Abs(seed);
            _generator = new System.Random(_seed);
        }

        public override bool Reset()
        {
            _generator = new System.Random(_seed);
            return true;
        }

        public override double NextDouble()
        {
            return _generator.NextDouble();
        }
    }
}
